using System;

namespace DesktopHelper.Models
{
    public class ClipboardItem
    {
        public int Id { get; set; }
        public ClipboardDataType Type { get; set; }
        public string? Content { get; set; }
        public byte[]? ImageData { get; set; }
        public byte[]? Thumbnail { get; set; }
        public DateTime CreateTime { get; set; }
        public bool IsFavorite { get; set; }
        public string? Hash { get; set; }
        
        public string DisplayText
        {
            get
            {
                return Type switch
                {
                    ClipboardDataType.Text => Content?.Length > 50 ? Content[..50] + "..." : Content ?? "",
                    ClipboardDataType.Image => $"图片 ({CreateTime:HH:mm:ss})",
                    ClipboardDataType.File => $"文件: {Content}",
                    _ => "未知类型"
                };
            }
        }
    }

    public enum ClipboardDataType
    {
        Text,
        Image,
        File
    }
}